package androidapp.firstapp;

import java.util.Vector;

import android.content.Intent;
import android.content.pm.ActivityInfo;
import android.os.Bundle;
import android.widget.Button;

public class FourPuzzles extends Nine_puzzles {

/*
	ArrayList<Bitmap> chunkedImages;
	int blanknr;
	Button blankButton;
	Vector<Button> buttonVector;
	int[] game_array;
	int moveCount;
	BitmapDrawable removedFragment;
	int removedId;
	boolean isRunning;*/
	
	Button button40;
	Button button41;
	Button button42;
	Button button43;
	Button button44;
	Button button45;
	Button button46;
	Button button47;
	Button button48;
	Button button49;
	Button button410;
	Button button411;
	Button button412;
	Button button413;
	Button button414;
	Button button415;

	

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_four_puzzles);
		Intent intent = getIntent();
		String imgFile = intent.getStringExtra(MainActivity.EXTRA_MESSAGE);
		size = 4;
		game_array = new int[size*size];
		moveCount = 0;
		int chunkNumbers = intent.getIntExtra("Chunks",size*size);
		splitImage(imgFile, chunkNumbers);
		 this.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
		
		button40  = (Button) this.findViewById(R.id.button40 );
		button41  = (Button) this.findViewById(R.id.button41 );
		button42  = (Button) this.findViewById(R.id.button42 );
		button43  = (Button) this.findViewById(R.id.button43 );
		button44  = (Button) this.findViewById(R.id.button44 );
		button45  = (Button) this.findViewById(R.id.button45 );
		button46  = (Button) this.findViewById(R.id.button46 );
		button47  = (Button) this.findViewById(R.id.button47 );
		button48  = (Button) this.findViewById(R.id.button48 );
		button49  = (Button) this.findViewById(R.id.button49 );
		button410 = (Button) this.findViewById(R.id.button410);
		button411 = (Button) this.findViewById(R.id.button411);
		button412 = (Button) this.findViewById(R.id.button412);
		button413 = (Button) this.findViewById(R.id.button413);
		button414 = (Button) this.findViewById(R.id.button414);
		button415 = (Button) this.findViewById(R.id.button415);

		buttonVector = new Vector<Button>();

		buttonVector.add(button40 );
		buttonVector.add(button41 );
		buttonVector.add(button42 );
		buttonVector.add(button43 );
		buttonVector.add(button44 );
		buttonVector.add(button45 );
		buttonVector.add(button46 );
		buttonVector.add(button47 );
		buttonVector.add(button48 );
		buttonVector.add(button49 );
		buttonVector.add(button410);
		buttonVector.add(button411);
		buttonVector.add(button412);
		buttonVector.add(button413);
		buttonVector.add(button414);
		buttonVector.add(button415);
		
		showPreview();
		
		
		
		
	}
	}
